package com.example.service.impl;

import com.example.mapper.Sys_UserMapper;
import com.example.po.Sys_User;
import com.example.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @auter czcjq
 * @date 2022/5/16 17:22
 */
@Service
@Transactional
public class SysUserServiceImpl implements SysUserService {
    @Autowired
    private Sys_UserMapper sysUserMapper;

    @Override
    public Sys_User login(String tel, String password) {

        Sys_User user = sysUserMapper.findUserByTelAndPassword(tel, password);
        System.out.println(user);
        return user;

    }



    @Override
    public int register(Sys_User user) {
        int i = sysUserMapper.addUser(user);
        System.out.println(i);
        return i;

    }

    @Override
    public boolean updateOne(Sys_User user) {
        int i= sysUserMapper.updateOne(user);
        if(1>-1){
            return true;
        }
        return false;

    }
}
